Linux under the UTF8 encoding batch conversion to GB2312 encoding method in Sqlplus import UTF8 encoded SQL script will appear garbled error, then need to convert UTF8 encoding GB2312 code, below for everyone to introduce under Linux how to
Recently in the system, encountered a problem, the transaction system using UTF-8 encoding, and some support systems are using gb2312 encoding.
If pages and scripts of different codes are referenced from each other, garbled characters are
Php implements the function code for mutual conversion between UTF-8 and GB2312 encoding. Copy the code as follows :? Php *************************************** * ****** function name: get_utf8_to_gb ($ value) * function: utf8 encoded string
First, allow me to repeat the wheel
The gb2312 encoding for Silverlight has appeared on the network for a long time, but many problems have been found after use:
Stream operations not supported
No rollback Policy
Only decoding is implemented,
Use gb2312 to encode Chinese Characters in js. For example, "I" should be encoded with "% CE % D2 ". Requirement
Use gb2312 to encode Chinese Characters in js. For example, "I" should be encoded with "% CE % D2 ".
Analysis
As you know, encodeURI
If pages and scripts of different codes are referenced from each other, garbled characters are generated.
In Asp.net, if you want to modify the encoding of the output page, you can modify the following configuration information in Web. config:
System: Win7 (format: Chinese (Simplified, China))Tools: Eclipse (default encoding Utf-8)Two services: "RESTful interface" and "Service server".Scenario: "Service Server" calls the "RESTful interface" multiple times, and each time the "RESTful
Requirement
Use gb2312 to encode Chinese Characters in Js. For example, "I" should be encoded with "% Ce % D2 ".
Analysis As you know, encodeuri and encodeuricomponent use UTF-8 encoding, for example, "% E6 % 88% 91" after "I" encoding ".
Php implements a function for mutual conversion between UTF-8 and GB2312 encoding. if you need it, refer
The code is as follows:
/*************************************** ******* Function name: get_utf8_to_gb ($ value)* Use: utf8 encoded string
In C/C + +, ASCII is supported, but GB2312 is compatible with ASCII in Chinese character coding, so the GB2312 encoding of Chinese characters can be obtainedThe GB2312 is two bytes, the first byte is high eight bits, the second byte is low eight
Use gb2312 to encode Chinese Characters in js. For example, "I" should be encoded with "% CE % D2 ".
Requirement
Use gb2312 to encode Chinese Characters in js. For example, "I" should be encoded with "% CE % D2 ".
Analysis
As you know, encodeURI
Requirement
Use gb2312 to encode Chinese Characters in Js. For example, "I" should be encoded with "% Ce % D2 ".
Analysis
As you know, encodeuri and encodeuricomponent use UTF-8 encoding, for example, "% E6 % 88% 91" after "I" encoding ".
Unicode, UTF-8, gb2312 encoding Recognition
There is a character named "Zero Width no-break space" in the UCS encoding, and its encoding is feff. Fffe does not exist in the UCs, so it should not appear in actual transmission. We recommend that you
Asp.net| Code | conversion
In a recent system, a problem has been encountered with the UTF-8 encoding of the trading system, while some support systems use GB2312 encoding.
Different coding of the pages, the script to each other, will produce
Demand
In JS, Chinese is encoded with gb2312. For example, the "I" Code should be "%ce%d2".
Analysis
As you know, encodeURI and encodeURIComponent will use Utf-8 code, such as "I" Code is "%e6%88%91". According to the experiment, there seems to
// Convert the encoding to gb2312 encoding function urlencode (STR) {var I, C, ret = "", strspecial = "! \ "# $ % & '() * +,/:; ? @ [\] ^ '{| }~ % "; For (I = 0; I = 0x4e00) {c = parseint (Z [Str. charcodeat (I)], 16); If (C 0; t = T-2) if
Cocos2d-x is a good mobile game framework, but because of the use of visual stdio2008 in Chinese Windows System Default created class files, including. h and. cpp, its file encoding is gb2312. When these files are compiled on cygwin with ndk,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.